---
title: Visualization Tools
---

## Code

```python cookbook/tools/visualization_tools.py
from agno.agent import Agent
from agno.tools.visualization import VisualizationTools

agent = Agent(
    instructions=[
        "You are a data visualization assistant that creates charts and plots",
        "Generate clear, informative visualizations based on user data",
        "Save charts to files and provide insights about the data",
    ],
    tools=[VisualizationTools(output_dir="charts")],
    markdown=True,
)

agent.print_response("Create a bar chart showing sales by quarter: Q1=100, Q2=150, Q3=120, Q4=180")
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Set your API key">
    ```bash
    export OPENAI_API_KEY=xxx
    ```
  </Step>

  <Step title="Install libraries">
    ```bash
    pip install -U matplotlib openai agno
    ```
  </Step>

  <Step title="Run Agent">
    <CodeGroup>
    ```bash Mac
    python cookbook/tools/visualization_tools.py
    ```

    ```bash Windows
    python cookbook/tools/visualization_tools.py
    ```
    </CodeGroup>
  </Step>
</Steps>
